import { dayjs } from "element-plus";

/**
 * 导出表格
 */
export default (data, name) => {
    const url = URL.createObjectURL(data);
    const link = document.createElement('a');
    link.href = url;
    link.setAttribute('download', name+'-'+dayjs().format('YYYYMMDDHHmmss'));
    document.body.appendChild(link);
    link.click();
    document.body.removeChild(link);
    URL.revokeObjectURL(url);
}